<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Jekyll v4.1.1">
    <title>Dashboard Template · Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"
          integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">

    <style>
        .bd-placeholder-img {
            font-size: 1.125rem;
            text-anchor: middle;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        @media (min-width: 768px) {
            .bd-placeholder-img-lg {
                font-size: 3.5rem;
            }
        }
    </style>
    <!-- Custom styles for this template -->
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
</head>
<body>
<div th:replace="~{common/common::topbar}"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="~{common/common::sidebar(act='employeeList.html')}"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-md-4">

            <h2>Section title</h2>

            <a th:href="@{/toAdd}" class="btn btn-success">添加员工</a>

            <p class="clearfix"></p>

            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>name</th>
                        <th>gender</th>
                        <th>department</th>
                        <th>birth</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="employee : ${employeelist}">
                        <td th:text="${employee.id}"></td>
                        <td th:text="${employee.name}"></td>
                        <td th:text="${employee.gender=='0'} ? '女' : '男'"></td>
                        <td th:text="${employee.department.name}"></td>
                        <td th:text="${#dates.format(employee.birth, 'yyyy-MM-dd HH:mm')}"></td>
                        <td>
                            <a th:href="@{'/toUpdate/' + ${employee.id}}" class="btn btn-sm btn-primary">修改</a>
                            <a th:href="@{'/delEmp/' + ${employee.id}}" class="btn btn-sm btn-danger">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </main>
    </div>
</div>
<script th:src="@{https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js}"></script>

</body>
</html>